home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9770 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: gizmo.cs.msstate.edu!shekar
  2. From: shekar@gizmo.cs.msstate.edu (Shekar Ramanathan)
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: Re: IS THIS LEGAL? Static method returns pointer to class
  5. Followup-To: gnu.g++.help,comp.lang.c++
  6. Date: 4 Mar 1996 12:41:55 GMT
  7. Organization: Mississippi State University
  8. Message-ID: <4heoej$70v@NNTP.MsState.Edu>
  9. References: <4hdu70$efa@panix.com>
  10. NNTP-Posting-Host: gizmo.cs.msstate.edu
  11. X-Newsreader: TIN [version 1.2 PL0]
  12.  
  13. Arthur Cinader Jr (acinader@panix.com) wrote:
  14.  
  15. > The parameters are checked and if all is ok, a Triangle
  16. > instance is "newed" and the pointer to the new Trinagle is
  17. > returned.  When I compile, I get the following error:
  18.  
  19. > % g++ -c triangle.C
  20. > In file included from triangle.C:8:
  21. > triangle.h:17: syntax error before `*'
  22. > ...
  23. > %
  24.  
  25. > ***The declaration for the class:
  26.  
  27. [...]
  28.  
  29. >      10 class Trianlge : public Point {
  30.         ^^^^^^^^
  31. If you included the exact code, the above typo may be the culprit.
  32.  
  33. And IMHO, I think a Triangle is not "is-a" Point but rather it is 
  34. composed of points.  So I think Triangle should not inherit from Point.
  35. Just a thought.
  36.  
  37. Shekar
  38.  
  39. --
  40. ---------------------------------------------------------------------
  41. Shekar Ramanathan              |   mailto:shekar@CS.MsState.edu
  42. Department of Computer Science |   http://www.cs.msstate.edu/~shekar
  43. Mississippi State University   |   
  44.  
  45. For the latest in World Cup Cricket, finger shekar@cs.msstate.edu
  46. ---------------------------------------------------------------------
  47.